var newsTable;
function getpointRecordList() {
    if (typeof newsTable !== 'undefined') {
        newsTable.fnPageChange('first');
        return;
    }
    var i = 1;
    newsTable = $("#pointRecordList").DataTable({
        "sAjaxSource": _path + "/pointRecord/queryByPage",          
        "fnServerParams": function (aoData) {
            aoData.push(
            	{ "name": "createTime", "value": $("#fromDate").val()+","+$("#toDate").val()},
              
                {"name": "name" ,"value":$("#name").val()}
            );
        },
        "sServerMethod": "POST",
        "sAjaxDataProp": "dataList",
        "fnCreatedRow": function () {
            i++;
        },
        "fnPreDrawCallback": function () {
            i = 1;
        },
        "aoColumns": [
            { "sTitle": "序号", "sWidth": "2%",
                "mData": function () {
                    return i;
                }
            },    
            { "sTitle": "订单号", "mData": "orderNo", "sWidth": "10%" },
            { "sTitle": "用户名", "mData": "username", "sWidth": "10%" },
			{
				"sTitle" : "操作",
				"sWidth" : "10%",
				  "mData": function (data) {
					var chatType = '';
					switch (data.rpType) {
					case '0':
						chatType = '购买';
						break;
					case '1':
						chatType = '提现';
						break;
				 
					}
					return chatType;
				}
			},
            { "sTitle": "商品", "mData": "productxname", "sWidth": "10%" },
            { "sTitle": "时间", "mData": "createTime", "sWidth": "10%" },
            { "sTitle": "加减分", "sWidth": "10%",
                "mData": function (data) {
         			var chatType = '';
					switch (data.type) {
					case '0':
						chatType = '+'+data.total;
						break;
					case '1':
						chatType = '-'+data.total;
						break;
		
					}
					return chatType;
                }
                
            }
        ]
    });
    

}


/*,
{ "sTitle": "操作", "sWidth": "10%",
    "mData": function (data) {
        var status = '<a href="' + _path + '/pointRecord/edit/' + data.id + '" class="btn default btn-xs purple"><i class="fa fa-edit" title="编辑"></i></a>';
        status += '<a href="' + _path + '/pointRecord/del/' + data.id + '"  class="btn default btn-xs red"><i class="fa fa-trash-o" title="删除"></i></a>';
        return status;
    }
}*/